package thread.threadPool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;

public class TestThreadPool {
    public static void main(String[] args) throws InterruptedException {
        MyThreadPool pool = new MyThreadPool(10);
        for(int i = 0; i < 1000; i++) {
            int id = i;//事实final，规避变量捕获
            pool.submit(() -> {
                System.out.println("执行" + id);
            });
        }
    }
}
